package com.yzd.learnjava.holding;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import com.yzd.learnjava.util.Print;
/*
 * Map 
 */
public class Statistics {

	public static void main(String[] args) {
		Random random = new Random();
		Map<Integer, Integer> m = new HashMap<Integer, Integer>();
		for(int i = 0 ; i < 10000; i++) {
			int r = random.nextInt(20);
			Integer freq = m.get(r);
			m.put(r, freq == null ? 1 : freq + 1);
		}
		Print.print(m);
	}

}
